package com.dhecp.project.base.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dhecp.common.core.controller.BaseController;
import com.dhecp.common.core.page.TableDataInfo;
import com.dhecp.core.constant.ModuleTable;
import com.dhecp.project.base.domain.CompanyInfo;
import com.dhecp.project.base.service.CompanyInfoService;

/**
 * 公司信息 控制层
 * @author DH-LWL
 * @version 2020年12月17日
 */
@Controller
@RequestMapping("/base/company")
public class CompanyInfoController extends BaseController {
    private String moduleTable = ModuleTable.COMPANY_INFO;

    @Autowired
    private CompanyInfoService companyInfoService;

    /**
     * 按条件查询公司信息列表
     * @param params
     * @return TableDataInfo
     * @author DH-Xxj
     */
    @GetMapping("/list")
    @ResponseBody
    public TableDataInfo companyInfoListJson(@RequestParam Map<String, Object> params){
    	params.put("moduleTable", moduleTable);
    	List<CompanyInfo> list = new ArrayList<CompanyInfo>();
    	try{
    		list = companyInfoService.queryCompanyInfoList(params);
    	}catch(Exception e){
    		return getDataTable(this.getExceptionMessage(e).toString());
    	}
    	return getDataTable(list);
    }

}
